home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / MacTCP.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  20.9 KB  |  613 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MacTCP.a
  3. ;
  4. ;    Contains:    TCP Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    MacTCP 2.0.6
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1989-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__MACTCP__') = 'UNDEFINED' THEN
  18. __MACTCP__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  24.     include 'MixedMode.a'
  25.     ENDIF
  26.     IF &TYPE('__APPLETALK__') = 'UNDEFINED' THEN
  27.     include 'AppleTalk.a'
  28.     ENDIF
  29.  
  30. ;Developer Notes:
  31. ;        0. This MacTCP header replaces what used to be defined in the following header files
  32. ;            MacTCPCommonTypes.h
  33. ;            GetMyIPAddr.h
  34. ;            MiscIPPB.h
  35. ;            TCPPB.h
  36. ;            UDPPB.h 
  37. ;            
  38. ;            When the various control calls are made to the ip driver, you must set up a 
  39. ;            NewRoutineDescriptor for every non-nil completion routine and/or notifyProc parameter.  
  40. ;            Otherwise, the 68K driver code, will not correctly call your routine.
  41. ;        1. For ipctlGetAddr Control calls, use NewGetIPIOCompletionProc
  42. ;            to set up a GetIPIOCompletionUPP universal procptr to pass as
  43. ;            the ioCompletion parameter.
  44. ;        2. For the ipctlEchoICMP and ipctlLAPStats Control calls, use 
  45. ;            NewIPIOCompletion to set up a IPIOCompletionUPP universal procptr
  46. ;            to pass in the ioCompletion field of the parameter block.
  47. ;        3. For TCPCreatePB Control calls, use NewTCPNotifyProc to set up a
  48. ;            TCPNotifyUPP universal procptr to pass in the notifyProc field
  49. ;            of the parameter block
  50. ;        4. For all of the TCP Control calls using the TCPiopb parameter block,
  51. ;            use NewTCPIOCompletionProc to set up a TCPIOCompletionUPP
  52. ;            universal procptr to pass in the ioCompletion field of the paramter
  53. ;            block.
  54. ;        5. For UDBCreatePB Control calls, use NewUDPNotifyProc to set up a
  55. ;            UDPNotifyUPP universal procptr to pass in the notifyProc field
  56. ;            of the parameter block
  57. ;        6. For all of the UDP Control calls using the UDPiopb parameter block,
  58. ;            use NewUDPIOCompletionProc to set up a UDPIOCompletionUPP
  59. ;            universal procptr to pass in the ioCompletion field of the paramter
  60. ;            block.
  61. ;        7. For all calls implementing a notifyProc or ioCompletion routine
  62. ;            which was set up using a NewTCPRoutineProc call, do not call
  63. ;            DisposeRoutineSDescriptor on the universal procptr until
  64. ;            after the completion or notify proc has completed.
  65. ;
  66.  
  67.  
  68. ;  MacTCP return Codes in the range -23000 through -23049 
  69.  
  70. inProgress                        EQU        1                    ; I/O in progress 
  71. ipBadLapErr                        EQU        -23000                ; bad network configuration 
  72. ipBadCnfgErr                    EQU        -23001                ; bad IP configuration error 
  73. ipNoCnfgErr                        EQU        -23002                ; missing IP or LAP configuration error 
  74. ipLoadErr                        EQU        -23003                ; error in MacTCP load 
  75. ipBadAddr                        EQU        -23004                ; error in getting address 
  76. connectionClosing                EQU        -23005                ; connection is closing 
  77. invalidLength                    EQU        -23006
  78. connectionExists                EQU        -23007                ; request conflicts with existing connection 
  79. connectionDoesntExist            EQU        -23008                ; connection does not exist 
  80. insufficientResources            EQU        -23009                ; insufficient resources to perform request 
  81. invalidStreamPtr                EQU        -23010
  82. streamAlreadyOpen                EQU        -23011
  83. connectionTerminated            EQU        -23012
  84. invalidBufPtr                    EQU        -23013
  85. invalidRDS                        EQU        -23014
  86. invalidWDS                        EQU        -23014
  87. openFailed                        EQU        -23015
  88. commandTimeout                    EQU        -23016
  89. duplicateSocket                    EQU        -23017
  90. ;  Error codes from internal IP functions 
  91.  
  92. ipDontFragErr                    EQU        -23032                ; Packet too large to send w/o fragmenting 
  93. ipDestDeadErr                    EQU        -23033                ; destination not responding 
  94. icmpEchoTimeoutErr                EQU        -23035                ; ICMP echo timed-out 
  95. ipNoFragMemErr                    EQU        -23036                ; no memory to send fragmented pkt 
  96. ipRouteErr                        EQU        -23037                ; can't route packet off-net 
  97. nameSyntaxErr                    EQU        -23041
  98. cacheFault                        EQU        -23042
  99. noResultProc                    EQU        -23043
  100. noNameServer                    EQU        -23044
  101. authNameErr                        EQU        -23045
  102. noAnsErr                        EQU        -23046
  103. dnrErr                            EQU        -23047
  104. outOfMemory                        EQU        -23048
  105.  
  106.  
  107. BYTES_16WORD                    EQU        2                    ; bytes per = 16, bit ip word 
  108. BYTES_32WORD                    EQU        4                    ; bytes per = 32, bit ip word 
  109. BYTES_64WORD                    EQU        8                    ; bytes per = 64, bit ip word 
  110. ;  8-bit quantity 
  111. ; typedef UInt8                         b_8
  112.  
  113. ;  16-bit quantity 
  114. ; typedef UInt16                         b_16
  115.  
  116. ;  32-bit quantity 
  117. ; typedef UInt32                         b_32
  118.  
  119. ;  IP address is 32-bits 
  120. ; typedef b_32                             ip_addr
  121.  
  122. ip_addrbytes            RECORD 0
  123. addr                     ds.l    1                ; offset: $0 (0)
  124.                          ORG 0
  125. byte                     ds.b    4                ; offset: $0 (0)
  126. sizeof                     EQU *                    ; size:   $4 (4)
  127.                         ENDR
  128. wdsEntry                RECORD 0
  129. length                     ds.w    1                ; offset: $0 (0)        ;  length of buffer 
  130. ptr                         ds.l    1                ; offset: $2 (2)        ;  pointer to buffer 
  131. sizeof                     EQU *                    ; size:   $6 (6)
  132.                         ENDR
  133. rdsEntry                RECORD 0
  134. length                     ds.w    1                ; offset: $0 (0)        ;  length of buffer 
  135. ptr                         ds.l    1                ; offset: $2 (2)        ;  pointer to buffer 
  136. sizeof                     EQU *                    ; size:   $6 (6)
  137.                         ENDR
  138. ; typedef unsigned long                 BufferPtr
  139.  
  140. ; typedef unsigned long                 StreamPtr
  141.  
  142.  
  143. netUnreach                        EQU        0
  144. hostUnreach                        EQU        1
  145. protocolUnreach                    EQU        2
  146. portUnreach                        EQU        3
  147. fragReqd                        EQU        4
  148. sourceRouteFailed                EQU        5
  149. timeExceeded                    EQU        6
  150. parmProblem                        EQU        7
  151. missingOption                    EQU        8
  152. lastICMPMsgType                    EQU        32767
  153. ; typedef unsigned short                 ICMPMsgType
  154.  
  155. ; typedef b_16                             ip_port
  156.  
  157. ICMPReport                RECORD 0
  158. streamPtr                 ds.l    1                ; offset: $0 (0)
  159. localHost                 ds.l    1                ; offset: $4 (4)
  160. localPort                 ds.w    1                ; offset: $8 (8)
  161. remoteHost                 ds.l    1                ; offset: $A (10)
  162. remotePort                 ds.w    1                ; offset: $E (14)
  163. reportType                 ds.w    1                ; offset: $10 (16)
  164. optionalAddlInfo         ds.w    1                ; offset: $12 (18)
  165. optionalAddlInfoPtr         ds.l    1                ; offset: $14 (20)
  166. sizeof                     EQU *                    ; size:   $18 (24)
  167.                         ENDR
  168. ;  csCode to get our IP address 
  169.  
  170. ipctlGetAddr                    EQU        15
  171.  
  172.  
  173. GetAddrParamBlock        RECORD 0
  174. qLink                     ds.l    1                ; offset: $0 (0)
  175. qType                     ds.w    1                ; offset: $4 (4)
  176. ioTrap                     ds.w    1                ; offset: $6 (6)
  177. ioCmdAddr                 ds.l    1                ; offset: $8 (8)
  178. ioCompletion             ds.l    1                ; offset: $C (12)
  179. ioResult                 ds.w    1                ; offset: $10 (16)
  180. ioNamePtr                 ds.l    1                ; offset: $12 (18)
  181. ioVRefNum                 ds.w    1                ; offset: $16 (22)
  182. ioCRefNum                 ds.w    1                ; offset: $18 (24)
  183. csCode                     ds.w    1                ; offset: $1A (26)
  184. ourAddress                 ds.l    1                ; offset: $1C (28)        ;  our IP address 
  185. ourNetMask                 ds.l    1                ; offset: $20 (32)        ;  our IP net mask 
  186. sizeof                     EQU *                    ; size:   $24 (36)
  187.                         ENDR
  188. ;  control codes 
  189.  
  190. ipctlEchoICMP                    EQU        17                    ; send icmp echo 
  191. ipctlLAPStats                    EQU        19                    ; get lap stats 
  192.  
  193.  
  194.  
  195. ICMPParamBlock            RECORD 0
  196. qLink                     ds.l    1                ; offset: $0 (0)
  197. qType                     ds.w    1                ; offset: $4 (4)
  198. ioTrap                     ds.w    1                ; offset: $6 (6)
  199. ioCmdAddr                 ds.l    1                ; offset: $8 (8)
  200. ioCompletion             ds.l    1                ; offset: $C (12)
  201. ioResult                 ds.w    1                ; offset: $10 (16)
  202. ioNamePtr                 ds.l    1                ; offset: $12 (18)
  203. ioVRefNum                 ds.w    1                ; offset: $16 (22)
  204. ioCRefNum                 ds.w    1                ; offset: $18 (24)
  205. csCode                     ds.w    1                ; offset: $1A (26)
  206. params                     ds.w    11                ; offset: $1C (28)
  207. echoRequestOut             ds.l    1                ; offset: $32 (50)        ;  time in ticks of when the echo request went out 
  208. echoReplyIn                 ds.l    1                ; offset: $36 (54)        ;  time in ticks of when the reply was received 
  209. echoedData                 ds        rdsEntry        ; offset: $3A (58)        ;  data received in responce 
  210. options                     ds.l    1                ; offset: $40 (64)
  211. userDataPtr                 ds.l    1                ; offset: $44 (68)
  212. sizeof                     EQU *                    ; size:   $48 (72)
  213.                         ENDR
  214.  
  215.  
  216. IPParamBlock            RECORD 0
  217. qLink                     ds.l    1                ; offset: $0 (0)
  218. qType                     ds.w    1                ; offset: $4 (4)
  219. ioTrap                     ds.w    1                ; offset: $6 (6)
  220. ioCmdAddr                 ds.l    1                ; offset: $8 (8)
  221. ioCompletion             ds.l    1                ; offset: $C (12)
  222. ioResult                 ds.w    1                ; offset: $10 (16)
  223. ioNamePtr                 ds.l    1                ; offset: $12 (18)
  224. ioVRefNum                 ds.w    1                ; offset: $16 (22)
  225. ioCRefNum                 ds.w    1                ; offset: $18 (24)
  226. csCode                     ds.w    1                ; offset: $1A (26)
  227. dest                     ds.l    1                ; offset: $1C (28)        ;  echo to IP address 
  228. data                     ds        wdsEntry        ; offset: $20 (32)
  229. timeout                     ds.w    1                ; offset: $26 (38)
  230. options                     ds.l    1                ; offset: $28 (40)
  231. optLength                 ds.w    1                ; offset: $2C (44)
  232. icmpCompletion             ds.l    1                ; offset: $2E (46)
  233. userDataPtr                 ds.l    1                ; offset: $32 (50)
  234.                          ORG 28
  235. lapStatsPtr                 ds.l    1                ; offset: $1C (28)
  236.                          ORG 54
  237. sizeof                     EQU *                    ; size:   $36 (54)
  238.                         ENDR
  239.  
  240. nbp_entry                RECORD 0
  241. ip_address                 ds.l    1                ; offset: $0 (0)        ;  IP address 
  242. at_address                 ds        AddrBlock        ; offset: $4 (4)        ;  matching AppleTalk address 
  243. gateway                     ds.b    1                ; offset: $8 (8)        ;  TRUE if entry for a gateway 
  244. valid                     ds.b    1                ; offset: $9 (9)        ;  TRUE if LAP address is valid 
  245. probing                     ds.b    1                ; offset: $A (10)        ;  TRUE if NBP lookup pending 
  246. afiller                     ds.b    1                ; offset: $B (11)        ;  Filler for proper byte alignment     
  247. age                         ds.l    1                ; offset: $C (12)        ;  ticks since cache entry verified 
  248. access                     ds.l    1                ; offset: $10 (16)        ;  ticks since last access 
  249. filler                     ds.b    116                ; offset: $14 (20)        ;  for internal use only !!! 
  250. sizeof                     EQU *                    ; size:   $88 (136)
  251.                         ENDR
  252. Enet_addr                RECORD 0
  253. en_hi                     ds.w    1                ; offset: $0 (0)
  254. en_lo                     ds.l    1                ; offset: $2 (2)
  255. sizeof                     EQU *                    ; size:   $6 (6)
  256.                         ENDR
  257. arp_entry                RECORD 0
  258. age                         ds.w    1                ; offset: $0 (0)        ;  cache aging field 
  259. protocol                 ds.w    1                ; offset: $2 (2)        ;  Protocol type 
  260. ip_address                 ds.l    1                ; offset: $4 (4)        ;  IP address 
  261. en_address                 ds        Enet_addr        ; offset: $8 (8)        ;  matching Ethernet address 
  262. sizeof                     EQU *                    ; size:   $E (14)
  263.                         ENDR
  264. LAPStatsAddrXlation        RECORD 0
  265. arp_table                 ds.l    1                ; offset: $0 (0)
  266.                          ORG 0
  267. nbp_table                 ds.l    1                ; offset: $0 (0)
  268. sizeof                     EQU *                    ; size:   $4 (4)
  269.                         ENDR
  270. LAPStats                RECORD 0
  271. ifType                     ds.w    1                ; offset: $0 (0)
  272. ifString                 ds.l    1                ; offset: $2 (2)
  273. ifMaxMTU                 ds.w    1                ; offset: $6 (6)
  274. ifSpeed                     ds.l    1                ; offset: $8 (8)
  275. ifPhyAddrLength             ds.w    1                ; offset: $C (12)
  276. ifPhysicalAddress         ds.l    1                ; offset: $E (14)
  277. AddrXlation                 ds        LAPStatsAddrXlation ; offset: $12 (18)
  278. slotNumber                 ds.w    1                ; offset: $16 (22)
  279. sizeof                     EQU *                    ; size:   $18 (24)
  280.                         ENDR
  281. ;  number of ARP table entries 
  282.  
  283. ARP_TABLE_SIZE                    EQU        20
  284.  
  285. NBP_TABLE_SIZE                    EQU        20                    ; number of NBP table entries 
  286. NBP_MAX_NAME_SIZE                EQU        28
  287.  
  288.  
  289. ;  Command codes 
  290.  
  291. TCPCreate                        EQU        30
  292. TCPPassiveOpen                    EQU        31
  293. TCPActiveOpen                    EQU        32
  294. TCPSend                            EQU        34
  295. TCPNoCopyRcv                    EQU        35
  296. TCPRcvBfrReturn                    EQU        36
  297. TCPRcv                            EQU        37
  298. TCPClose                        EQU        38
  299. TCPAbort                        EQU        39
  300. TCPStatus                        EQU        40
  301. TCPExtendedStat                    EQU        41
  302. TCPRelease                        EQU        42
  303. TCPGlobalInfo                    EQU        43
  304. TCPCtlMax                        EQU        49
  305.  
  306. TCPClosing                        EQU        1
  307. TCPULPTimeout                    EQU        2
  308. TCPTerminate                    EQU        3
  309. TCPDataArrival                    EQU        4
  310. TCPUrgent                        EQU        5
  311. TCPICMPReceived                    EQU        6
  312. lastEvent                        EQU        32767
  313. ; typedef unsigned short                 TCPEventCode
  314.  
  315.  
  316. TCPRemoteAbort                    EQU        2
  317. TCPNetworkFailure                EQU        3
  318. TCPSecPrecMismatch                EQU        4
  319. TCPULPTimeoutTerminate            EQU        5
  320. TCPULPAbort                        EQU        6
  321. TCPULPClose                        EQU        7
  322. TCPServiceError                    EQU        8
  323. lastReason                        EQU        32767
  324. ; typedef unsigned short                 TCPTerminationReason
  325.  
  326. ; typedef unsigned short                 tcp_port
  327.  
  328. ;  ValidityFlags 
  329.  
  330. timeoutValue                    EQU        $80
  331. timeoutAction                    EQU        $40
  332. typeOfService                    EQU        $20
  333. precedence                        EQU        $10
  334. ;  TOSFlags 
  335.  
  336. lowDelay                        EQU        $01
  337. throughPut                        EQU        $02
  338. reliability                        EQU        $04
  339. TCPCreatePB                RECORD 0
  340. rcvBuff                     ds.l    1                ; offset: $0 (0)
  341. rcvBuffLen                 ds.l    1                ; offset: $4 (4)
  342. notifyProc                 ds.l    1                ; offset: $8 (8)
  343. userDataPtr                 ds.l    1                ; offset: $C (12)
  344. sizeof                     EQU *                    ; size:   $10 (16)
  345.                         ENDR
  346. TCPOpenPB                RECORD 0
  347. ulpTimeoutValue             ds.b    1                ; offset: $0 (0)
  348. ulpTimeoutAction         ds.b    1                ; offset: $1 (1)
  349. validityFlags             ds.b    1                ; offset: $2 (2)
  350. commandTimeoutValue         ds.b    1                ; offset: $3 (3)
  351. remoteHost                 ds.l    1                ; offset: $4 (4)
  352. remotePort                 ds.w    1                ; offset: $8 (8)
  353. localHost                 ds.l    1                ; offset: $A (10)
  354. localPort                 ds.w    1                ; offset: $E (14)
  355. tosFlags                 ds.b    1                ; offset: $10 (16)
  356. precedence                 ds.b    1                ; offset: $11 (17)
  357. dontFrag                 ds.b    1                ; offset: $12 (18)
  358. timeToLive                 ds.b    1                ; offset: $13 (19)
  359. security                 ds.b    1                ; offset: $14 (20)
  360. optionCnt                 ds.b    1                ; offset: $15 (21)
  361. options                     ds.b    40                ; offset: $16 (22)
  362. userDataPtr                 ds.l    1                ; offset: $3E (62)
  363. sizeof                     EQU *                    ; size:   $42 (66)
  364.                         ENDR
  365.  
  366. TCPSendPB                RECORD 0
  367. ulpTimeoutValue             ds.b    1                ; offset: $0 (0)
  368. ulpTimeoutAction         ds.b    1                ; offset: $1 (1)
  369. validityFlags             ds.b    1                ; offset: $2 (2)
  370. pushFlag                 ds.b    1                ; offset: $3 (3)
  371. urgentFlag                 ds.b    1                ; offset: $4 (4)
  372. filler                     ds.b    1                ; offset: $5 (5)        ;  Filler for proper byte alignment     
  373. wdsPtr                     ds.l    1                ; offset: $6 (6)
  374. sendFree                 ds.l    1                ; offset: $A (10)
  375. sendLength                 ds.w    1                ; offset: $E (14)
  376. userDataPtr                 ds.l    1                ; offset: $10 (16)
  377. sizeof                     EQU *                    ; size:   $14 (20)
  378.                         ENDR
  379.  
  380. ;  for receive and return rcv buff calls 
  381. ;    Note: the filler in the following structure is in a different location than 
  382. ;          that specified in the Programmer's Guide.  
  383. TCPReceivePB            RECORD 0
  384. commandTimeoutValue         ds.b    1                ; offset: $0 (0)
  385. markFlag                 ds.b    1                ; offset: $1 (1)
  386. urgentFlag                 ds.b    1                ; offset: $2 (2)
  387. filler                     ds.b    1                ; offset: $3 (3)        ;  Filler for proper byte alignment  
  388. rcvBuff                     ds.l    1                ; offset: $4 (4)
  389. rcvBuffLen                 ds.w    1                ; offset: $8 (8)
  390. rdsPtr                     ds.l    1                ; offset: $A (10)
  391. rdsLength                 ds.w    1                ; offset: $E (14)
  392. secondTimeStamp             ds.w    1                ; offset: $10 (16)
  393. userDataPtr                 ds.l    1                ; offset: $12 (18)
  394. sizeof                     EQU *                    ; size:   $16 (22)
  395.                         ENDR
  396.  
  397. TCPClosePB                RECORD 0
  398. ulpTimeoutValue             ds.b    1                ; offset: $0 (0)
  399. ulpTimeoutAction         ds.b    1                ; offset: $1 (1)
  400. validityFlags             ds.b    1                ; offset: $2 (2)
  401. filler                     ds.b    1                ; offset: $3 (3)        ;  Filler for proper byte alignment     
  402. userDataPtr                 ds.l    1                ; offset: $4 (4)
  403. sizeof                     EQU *                    ; size:   $8 (8)
  404.                         ENDR
  405. HistoBucket                RECORD 0
  406. value                     ds.w    1                ; offset: $0 (0)
  407. counter                     ds.l    1                ; offset: $2 (2)
  408. sizeof                     EQU *                    ; size:   $6 (6)
  409.                         ENDR
  410.  
  411. NumOfHistoBuckets                EQU        7
  412. TCPConnectionStats        RECORD 0
  413. dataPktsRcvd             ds.l    1                ; offset: $0 (0)
  414. dataPktsSent             ds.l    1                ; offset: $4 (4)
  415. dataPktsResent             ds.l    1                ; offset: $8 (8)
  416. bytesRcvd                 ds.l    1                ; offset: $C (12)
  417. bytesRcvdDup             ds.l    1                ; offset: $10 (16)
  418. bytesRcvdPastWindow         ds.l    1                ; offset: $14 (20)
  419. bytesSent                 ds.l    1                ; offset: $18 (24)
  420. bytesResent                 ds.l    1                ; offset: $1C (28)
  421. numHistoBuckets             ds.w    1                ; offset: $20 (32)
  422. sentSizeHisto             ds.b    7 * HistoBucket.sizeof ; offset: $22 (34)
  423. lastRTT                     ds.w    1                ; offset: $4C (76)
  424. tmrSRTT                     ds.w    1                ; offset: $4E (78)
  425. rttVariance                 ds.w    1                ; offset: $50 (80)
  426. tmrRTO                     ds.w    1                ; offset: $52 (82)
  427. sendTries                 ds.b    1                ; offset: $54 (84)
  428. sourchQuenchRcvd         ds.b    1                ; offset: $55 (85)
  429. sizeof                     EQU *                    ; size:   $56 (86)
  430.                         ENDR
  431. TCPStatusPB                RECORD 0
  432. ulpTimeoutValue             ds.b    1                ; offset: $0 (0)
  433. ulpTimeoutAction         ds.b    1                ; offset: $1 (1)
  434. unused                     ds.l    1                ; offset: $2 (2)
  435. remoteHost                 ds.l    1                ; offset: $6 (6)
  436. remotePort                 ds.w    1                ; offset: $A (10)
  437. localHost                 ds.l    1                ; offset: $C (12)
  438. localPort                 ds.w    1                ; offset: $10 (16)
  439. tosFlags                 ds.b    1                ; offset: $12 (18)
  440. precedence                 ds.b    1                ; offset: $13 (19)
  441. connectionState             ds.b    1                ; offset: $14 (20)
  442. filler                     ds.b    1                ; offset: $15 (21)        ;  Filler for proper byte alignment     
  443. sendWindow                 ds.w    1                ; offset: $16 (22)
  444. rcvWindow                 ds.w    1                ; offset: $18 (24)
  445. amtUnackedData             ds.w    1                ; offset: $1A (26)
  446. amtUnreadData             ds.w    1                ; offset: $1C (28)
  447. securityLevelPtr         ds.l    1                ; offset: $1E (30)
  448. sendUnacked                 ds.l    1                ; offset: $22 (34)
  449. sendNext                 ds.l    1                ; offset: $26 (38)
  450. congestionWindow         ds.l    1                ; offset: $2A (42)
  451. rcvNext                     ds.l    1                ; offset: $2E (46)
  452. srtt                     ds.l    1                ; offset: $32 (50)
  453. lastRTT                     ds.l    1                ; offset: $36 (54)
  454. sendMaxSegSize             ds.l    1                ; offset: $3A (58)
  455. connStatPtr                 ds.l    1                ; offset: $3E (62)
  456. userDataPtr                 ds.l    1                ; offset: $42 (66)
  457. sizeof                     EQU *                    ; size:   $46 (70)
  458.                         ENDR
  459. TCPAbortPB                RECORD 0
  460. userDataPtr                 ds.l    1                ; offset: $0 (0)
  461. sizeof                     EQU *                    ; size:   $4 (4)
  462.                         ENDR
  463. TCPParam                RECORD 0
  464. tcpRtoA                     ds.l    1                ; offset: $0 (0)
  465. tcpRtoMin                 ds.l    1                ; offset: $4 (4)
  466. tcpRtoMax                 ds.l    1                ; offset: $8 (8)
  467. tcpMaxSegSize             ds.l    1                ; offset: $C (12)
  468. tcpMaxConn                 ds.l    1                ; offset: $10 (16)
  469. tcpMaxWindow             ds.l    1                ; offset: $14 (20)
  470. sizeof                     EQU *                    ; size:   $18 (24)
  471.                         ENDR
  472. TCPStats                RECORD 0
  473. tcpConnAttempts             ds.l    1                ; offset: $0 (0)
  474. tcpConnOpened             ds.l    1                ; offset: $4 (4)
  475. tcpConnAccepted             ds.l    1                ; offset: $8 (8)
  476. tcpConnClosed             ds.l    1                ; offset: $C (12)
  477. tcpConnAborted             ds.l    1                ; offset: $10 (16)
  478. tcpOctetsIn                 ds.l    1                ; offset: $14 (20)
  479. tcpOctetsOut             ds.l    1                ; offset: $18 (24)
  480. tcpOctetsInDup             ds.l    1                ; offset: $1C (28)
  481. tcpOctetsRetrans         ds.l    1                ; offset: $20 (32)
  482. tcpInputPkts             ds.l    1                ; offset: $24 (36)
  483. tcpOutputPkts             ds.l    1                ; offset: $28 (40)
  484. tcpDupPkts                 ds.l    1                ; offset: $2C (44)
  485. tcpRetransPkts             ds.l    1                ; offset: $30 (48)
  486. sizeof                     EQU *                    ; size:   $34 (52)
  487.                         ENDR
  488. ; typedef StreamPtr *                    StreamPPtr
  489.  
  490. TCPGlobalInfoPB            RECORD 0
  491. tcpParamPtr                 ds.l    1                ; offset: $0 (0)
  492. tcpStatsPtr                 ds.l    1                ; offset: $4 (4)
  493. tcpCDBTable                 ds.l    1                ; offset: $8 (8) <-- really an array of length one
  494. userDataPtr                 ds.l    1                ; offset: $C (12)
  495. maxTCPConnections         ds.w    1                ; offset: $10 (16)
  496. sizeof                     EQU *                    ; size:   $12 (18)
  497.                         ENDR
  498.  
  499.  
  500. TCPiopb                    RECORD 0
  501. fill12                     ds.b    12                ; offset: $0 (0)
  502. ioCompletion             ds.l    1                ; offset: $C (12)
  503. ioResult                 ds.w    1                ; offset: $10 (16)
  504. ioNamePtr                 ds.l    1                ; offset: $12 (18)
  505. ioVRefNum                 ds.w    1                ; offset: $16 (22)
  506. ioCRefNum                 ds.w    1                ; offset: $18 (24)
  507. csCode                     ds.w    1                ; offset: $1A (26)
  508. tcpStream                 ds.l    1                ; offset: $1C (28)
  509. create                     ds        TCPCreatePB        ; offset: $20 (32)
  510.                          ORG 32
  511. open                     ds        TCPOpenPB        ; offset: $20 (32)
  512.                          ORG 32
  513. send                     ds        TCPSendPB        ; offset: $20 (32)
  514.                          ORG 32
  515. receive                     ds        TCPReceivePB    ; offset: $20 (32)
  516.                          ORG 32
  517. close                     ds        TCPClosePB        ; offset: $20 (32)
  518.                          ORG 32
  519. abort                     ds        TCPAbortPB        ; offset: $20 (32)
  520.                          ORG 32
  521. status                     ds        TCPStatusPB        ; offset: $20 (32)
  522.                          ORG 32
  523. globalInfo                 ds        TCPGlobalInfoPB ; offset: $20 (32)
  524.                          ORG 102
  525. sizeof                     EQU *                    ; size:   $66 (102)
  526.                         ENDR
  527.  
  528. UDPCreate                        EQU        20
  529. UDPRead                            EQU        21
  530. UDPBfrReturn                    EQU        22
  531. UDPWrite                        EQU        23
  532. UDPRelease                        EQU        24
  533. UDPMaxMTUSize                    EQU        25
  534. UDPStatus                        EQU        26
  535. UDPMultiCreate                    EQU        27
  536. UDPMultiSend                    EQU        28
  537. UDPMultiRead                    EQU        29
  538. UDPCtlMax                        EQU        29
  539.  
  540. UDPDataArrival                    EQU        1
  541. UDPICMPReceived                    EQU        2
  542. lastUDPEvent                    EQU        32767
  543. ; typedef unsigned short                 UDPEventCode
  544.  
  545. ; typedef unsigned short                 udp_port
  546.  
  547. ;  for create and release calls 
  548. UDPCreatePB                RECORD 0
  549. rcvBuff                     ds.l    1                ; offset: $0 (0)
  550. rcvBuffLen                 ds.l    1                ; offset: $4 (4)
  551. notifyProc                 ds.l    1                ; offset: $8 (8)
  552. localPort                 ds.w    1                ; offset: $C (12)
  553. userDataPtr                 ds.l    1                ; offset: $E (14)
  554. endingPort                 ds.w    1                ; offset: $12 (18)
  555. sizeof                     EQU *                    ; size:   $14 (20)
  556.                         ENDR
  557. UDPSendPB                RECORD 0
  558. reserved                 ds.w    1                ; offset: $0 (0)
  559. remoteHost                 ds.l    1                ; offset: $2 (2)
  560. remotePort                 ds.w    1                ; offset: $6 (6)
  561. wdsPtr                     ds.l    1                ; offset: $8 (8)
  562. checkSum                 ds.b    1                ; offset: $C (12)
  563. filler                     ds.b    1                ; offset: $D (13)        ;  Filler for proper byte alignment     
  564. sendLength                 ds.w    1                ; offset: $E (14)
  565. userDataPtr                 ds.l    1                ; offset: $10 (16)
  566. localPort                 ds.w    1                ; offset: $14 (20)
  567. sizeof                     EQU *                    ; size:   $16 (22)
  568.                         ENDR
  569. ;  for receive and buffer return calls 
  570. UDPReceivePB            RECORD 0
  571. timeOut                     ds.w    1                ; offset: $0 (0)
  572. remoteHost                 ds.l    1                ; offset: $2 (2)
  573. remotePort                 ds.w    1                ; offset: $6 (6)
  574. rcvBuff                     ds.l    1                ; offset: $8 (8)
  575. rcvBuffLen                 ds.w    1                ; offset: $C (12)
  576. secondTimeStamp             ds.w    1                ; offset: $E (14)
  577. userDataPtr                 ds.l    1                ; offset: $10 (16)
  578. destHost                 ds.l    1                ; offset: $14 (20)        ;  only for use with multi rcv 
  579. destPort                 ds.w    1                ; offset: $18 (24)        ;  only for use with multi rcv 
  580. sizeof                     EQU *                    ; size:   $1A (26)
  581.                         ENDR
  582. UDPMTUPB                RECORD 0
  583. mtuSize                     ds.w    1                ; offset: $0 (0)
  584. remoteHost                 ds.l    1                ; offset: $2 (2)
  585. userDataPtr                 ds.l    1                ; offset: $6 (6)
  586. sizeof                     EQU *                    ; size:   $A (10)
  587.                         ENDR
  588.  
  589.  
  590. UDPiopb                    RECORD 0
  591. fill12                     ds.b    12                ; offset: $0 (0)
  592. ioCompletion             ds.l    1                ; offset: $C (12)
  593. ioResult                 ds.w    1                ; offset: $10 (16)
  594. ioNamePtr                 ds.l    1                ; offset: $12 (18)
  595. ioVRefNum                 ds.w    1                ; offset: $16 (22)
  596. ioCRefNum                 ds.w    1                ; offset: $18 (24)
  597. csCode                     ds.w    1                ; offset: $1A (26)
  598. udpStream                 ds.l    1                ; offset: $1C (28)
  599. create                     ds        UDPCreatePB        ; offset: $20 (32)
  600.                          ORG 32
  601. send                     ds        UDPSendPB        ; offset: $20 (32)
  602.                          ORG 32
  603. receive                     ds        UDPReceivePB    ; offset: $20 (32)
  604.                          ORG 32
  605. mtu                         ds        UDPMTUPB        ; offset: $20 (32)
  606.                          ORG 58
  607. sizeof                     EQU *                    ; size:   $3A (58)
  608.                         ENDR
  609.  
  610.     ENDIF ; __MACTCP__ 
  611.  
  612.